﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.display.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import flash.text.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class GenericPictureDialogView extends GenericDialogView {

        protected var m_acceptTextToken:String;
        protected var m_mainImage:DisplayObject;
        protected var m_imagePanel:JPanel;

        public function GenericPictureDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="", _arg7:int=0, _arg8:String=""){
            this.m_acceptTextToken = _arg8;
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
        }
        override protected function init():void{
            m_acceptTextName = ZLoc.t("Dialogs", this.m_acceptTextToken);
            m_bgAsset = m_assetDict["dialog_bg"];
            makeBackground();
            makeCenterPanel();
            ASwingHelper.prepare(this);
        }
        override protected function createTitlePanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            title = ASwingHelper.makeTextField(m_titleString, EmbeddedArt.TITLE_FONT, m_titleFontSize, EmbeddedArt.titleColor);
            title.filters = EmbeddedArt.titleFilters;
            var _local2:TextFormat = new TextFormat();
            _local2.size = m_titleSmallCapsFontSize;
            TextFieldUtil.formatSmallCaps(title.getTextField(), _local2);
            _local1.append(title);
            title.getTextField().height = (m_titleFontSize * 1.5);
            ASwingHelper.setEasyBorder(_local1, 4);
            return (_local1);
        }
        override protected function createInteriorHolder():JPanel{
            var _local1:JPanel;
            var _local6:JPanel;
            _local1 = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, -10, SoftBoxLayout.TOP));
            var _local2:JPanel = createHeaderPanel();
            ASwingHelper.prepare(_local2);
            textArea = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local3:AssetPane = ASwingHelper.makeMultilineText(this.m_message, 450, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 16, EmbeddedArt.brownTextColor);
            var _local4:JPanel = ASwingHelper.centerElement(_local3);
            ASwingHelper.setEasyBorder(_local4, 0, 10, 0, 10);
            this.m_imagePanel = this.makeImagePanel();
            var _local5:JPanel = ASwingHelper.centerElement(this.m_imagePanel);
            ASwingHelper.setEasyBorder(_local5, 0, 20, 0, 20);
            textArea.append(_local4);
            textArea.append(_local5);
            ASwingHelper.prepare(textArea);
            _local1.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 0)));
            if (m_type != TYPE_NOBUTTONS){
                _local1.append(_local2);
            };
            _local1.append(ASwingHelper.verticalStrut(20));
            _local1.append(textArea);
            _local1.append(ASwingHelper.verticalStrut(BUTTON_MARGIN));
            if (((!((m_type == TYPE_MODAL))) && (!((m_type == TYPE_NOBUTTONS))))){
                _local6 = createButtonPanel();
                _local1.append(_local6);
            };
            ASwingHelper.prepare(_local1);
            _local2.setPreferredWidth(_local1.getWidth());
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        protected function makeImagePanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            ASwingHelper.setSizedBackground(_local1, m_assetDict["image"], new Insets(0, 0, 10, 0));
            return (_local1);
        }

    }
}//package Display.DialogUI 
